#ifndef CAMPAIGNFORM_H
#define CAMPAIGNFORM_H

#include "levelsproxymodel.h"
#include "skillsproxymodel.h"
#include "specialsproxymodel.h"

#include <dtwentymodel.h>

#include <QWidget>
#include <QFileInfo>
#include <QSortFilterProxyModel>


namespace Ui {
class CampaignForm;
}

class CampaignForm : public QWidget
{
    Q_OBJECT
    
public:

    explicit CampaignForm(QWidget *parent = 0);
    ~CampaignForm();

    void create();
    bool open(const QString& fileName = QString());
    bool save(const QString& fileName = QString());

    QFileInfo fileInfo() const;

signals:

    void sigCharacterClassAdded(int index);


protected slots:

    void onLevelChanged();

    void onUpdateCharacterClassComboBox();
    void onUpdateSkillListView();
    void onUpdateSpecialListView();

    void onCharacterClassAdded();


protected:

    QModelIndex sourceIndex(const QModelIndex& index) const;


private slots:

    void on_comboBox_currentIndexChanged(int index);

    void on_pushButtonAddSkill_clicked();

    void on_pushButtonDelSkill_clicked();

    void on_pushButtonAddSpecial_clicked();

    void on_pushButtonDelSpecial_clicked();


    void on_actionAdd_Skill_triggered();

    void on_actionAdd_Special_Ability_triggered();

    void on_actionAdd_Character_Class_triggered();

    void on_actionAdd_Class_Level_triggered();

    void on_comboBox_currentTextChanged(const QString &text);

    void on_pushButtonAddLevel_clicked();

    void on_pushButtonDelLevel_clicked();

    void on_pushButtonAddClass_clicked();

    void on_pushButtonDelClass_clicked();

private:

    Ui::CampaignForm *ui;

    DTwentyModel* m_dtwentyModel;

    LevelsProxyModel* m_levelsModel;
    SkillsProxyModel* m_skillsModel;
    SpecialsProxyModel* m_specialsModel;

    QString m_fileName;


};


#endif // CAMPAIGNFORM_H
